﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="Small.index" %>
<asp:Content ID="Content1" runat="server" 
    contentplaceholderid="ContentPlaceHolder1">
    <table class="style29">
    <tr>
        <td style="text-align: center">
    <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1" 
        GroupItemCount="4" onselectedindexchanged="ListView1_SelectedIndexChanged" 
                style="text-align: center">
        <AlternatingItemTemplate>
            <td runat="server" style="">
                   <table class="style29">
                       <tr>
                           <td style="text-align: center">
                               <asp:Image ID="Image1" runat="server" Height="180px" 
                                   ImageUrl='<%# Eval("Images", "{0}") %>' Width="180px" />
                           </td>
                       </tr>
                       <tr>
                           <td class="style35" style="height: 24px">
                               &nbsp;<asp:Label ID="ProductNameLabel" runat="server" style="font-weight: 700" 
                                   Text='<%# Eval("ProductName") %>'></asp:Label>
                               <br />
                           </td>
                       </tr>
                       <tr>
                           <td class="style35">
                               &nbsp;<asp:Label ID="ProductPriceLabel" runat="server" style="color: #FF0000" 
                                   Text='<%# Eval("ProductPrice") %>'></asp:Label>
                               <br />
                           </td>
                       </tr>
                   </table>
                <br />
            </td>
        </AlternatingItemTemplate>
        <EditItemTemplate>
            <td runat="server" style="">
                ProductName:
                <asp:TextBox ID="ProductNameTextBox" runat="server" 
                    Text='<%# Bind("ProductName") %>' />
                <br />ProductPrice:
                <asp:TextBox ID="ProductPriceTextBox" runat="server" 
                    Text='<%# Bind("ProductPrice") %>' />
                <br />Images:
                <asp:TextBox ID="ImagesTextBox" runat="server" Text='<%# Bind("Images") %>' />
                <br />
                <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                    Text="Update" />
                <br />
                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                    Text="Cancel" />
                <br />
            </td>
        </EditItemTemplate>
        <EmptyDataTemplate>
            <table runat="server" style="">
                <tr>
                    <td>
                        No data was returned.</td>
                </tr>
            </table>
        </EmptyDataTemplate>
        <EmptyItemTemplate>
<td runat="server" />
        </EmptyItemTemplate>
        <GroupTemplate>
            <tr ID="itemPlaceholderContainer" runat="server">
                <td ID="itemPlaceholder" runat="server">
                </td>
            </tr>
        </GroupTemplate>
        <InsertItemTemplate>
            <td runat="server" style="">
                ProductName:
                <asp:TextBox ID="ProductNameTextBox" runat="server" 
                    Text='<%# Bind("ProductName") %>' />
                <br />ProductPrice:
                <asp:TextBox ID="ProductPriceTextBox" runat="server" 
                    Text='<%# Bind("ProductPrice") %>' />
                <br />Images:
                <asp:TextBox ID="ImagesTextBox" runat="server" Text='<%# Bind("Images") %>' />
                <br />
                <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                    Text="Insert" />
                <br />
                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                    Text="Clear" />
                <br />
            </td>
        </InsertItemTemplate>
        <ItemTemplate>
            <td runat="server" style="">
                   <table class="style29">
                       <tr>
                           <td style="text-align: center">
                               <asp:Image ID="Image1" runat="server" Height="180px" 
                                   ImageUrl='<%# Eval("Images", "{0}") %>' Width="180px" />
                           </td>
                       </tr>
                       <tr>
                           <td class="style35" style="height: 24px">
                               &nbsp;<asp:Label ID="ProductNameLabel" runat="server" style="font-weight: 700" 
                                   Text='<%# Eval("ProductName") %>'></asp:Label>
                               <br />
                           </td>
                       </tr>
                       <tr>
                           <td class="style35">
                               &nbsp;<asp:Label ID="ProductPriceLabel" runat="server" style="color: #FF0000" 
                                   Text='<%# Eval("ProductPrice") %>'></asp:Label>
                               <br />
                           </td>
                       </tr>
                   </table>
                <br />
            </td>
        </ItemTemplate>
        <LayoutTemplate>
            <table runat="server">
                <tr runat="server">
                    <td runat="server">
                        <table ID="groupPlaceholderContainer" runat="server" border="0" style="">
                            <tr ID="groupPlaceholder" runat="server">
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr runat="server">
                    <td runat="server" style="">
                        <asp:DataPager ID="DataPager1" runat="server" PageSize="12">
                            <Fields>
                                <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                                    ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                <asp:NumericPagerField />
                                <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" 
                                    ShowNextPageButton="False" ShowPreviousPageButton="False" />
                            </Fields>
                        </asp:DataPager>
                    </td>
                </tr>
            </table>
        </LayoutTemplate>
        <SelectedItemTemplate>
            <td runat="server" style="">
                ProductName:
                <asp:Label ID="ProductNameLabel" runat="server" 
                    Text='<%# Eval("ProductName") %>' />
                <br />ProductPrice:
                <asp:Label ID="ProductPriceLabel" runat="server" 
                    Text='<%# Eval("ProductPrice") %>' />
                <br />Images:
                <asp:Label ID="ImagesLabel" runat="server" Text='<%# Eval("Images") %>' />
                <br />
            </td>
        </SelectedItemTemplate>
    </asp:ListView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ShopDBConnectionString %>" 
        SelectCommand="SELECT [ProductName], [ProductPrice], [Images] FROM [Product]">
    </asp:SqlDataSource>
        </td>
    </tr>
</table>
</asp:Content>

